package org.hyou.demos.msg.seri;

import java.util.Random;

import org.hyou.demos.msg.seri.msg.BaseMessage;
import org.hyou.demos.msg.seri.msg.Header;
import org.hyou.demos.msg.seri.msg.X0100ReqRegister;

public class DataUtil {

    public static BaseMessage makeBaseMessage() {
        BaseMessage reqMsg = new BaseMessage();
        
        reqMsg.setCode("001");
        
        Header header = new Header();
        header.setVersion(128);
        header.setMsgCmdId(0x0100);
        header.setEncryptionType(0);
        header.setMobile("13987654321");
        header.setSerialId(new Random().nextInt(9000));
        header.setReserved(0x3C);
        
        reqMsg.setHeader(header);
        
        X0100ReqRegister body = new X0100ReqRegister();
        body.setProvinceId(11);
        body.setCityId(100);
        body.setManufacturer("70202");
        body.setModel("CV7000");
        body.setSerialNumber("6000003");
        body.setImei("355099048111994");
        body.setColor(2);
        body.setLicenseNum("京A1587学");
        
        reqMsg.setBody(body);
        
        return reqMsg;
    }
}
